\(\int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx\) [89]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 30, antiderivative size = 48 \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\frac {a c \log (\cos (e+f x)) \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}} \]

[Out]

a*c*ln(cos(f*x+e))*tan(f*x+e)/f/(a+a*sec(f*x+e))^(1/2)/(c-c*sec(f*x+e))^(1/2)

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {3990, 3556} \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\frac {a c \tan (e+f x) \log (\cos (e+f x))}{f \sqrt {a \sec (e+f x)+a} \sqrt {c-c \sec (e+f x)}} \]

[In]

Int[Sqrt[a + a*Sec[e + f*x]]*Sqrt[c - c*Sec[e + f*x]],x]

[Out]

(a*c*Log[Cos[e + f*x]]*Tan[e + f*x])/(f*Sqrt[a + a*Sec[e + f*x]]*Sqrt[c - c*Sec[e + f*x]])

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3990

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(m_), x_Symbol] :> Dist
[((-a)*c)^(m + 1/2)*(Cot[e + f*x]/(Sqrt[a + b*Csc[e + f*x]]*Sqrt[c + d*Csc[e + f*x]])), Int[Cot[e + f*x]^(2*m)
, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m + 1/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {(a c \tan (e+f x)) \int \tan (e+f x) \, dx}{\sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}} \\ & = \frac {a c \log (\cos (e+f x)) \tan (e+f x)}{f \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.27 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.06 \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\frac {c \log (\cos (e+f x)) \sqrt {a (1+\sec (e+f x))} \tan \left (\frac {1}{2} (e+f x)\right )}{f \sqrt {c-c \sec (e+f x)}} \]

[In]

Integrate[Sqrt[a + a*Sec[e + f*x]]*Sqrt[c - c*Sec[e + f*x]],x]

[Out]

(c*Log[Cos[e + f*x]]*Sqrt[a*(1 + Sec[e + f*x])]*Tan[(e + f*x)/2])/(f*Sqrt[c - c*Sec[e + f*x]])

Maple [A] (verified)

Time = 2.46 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.81

method result size
default \(-\frac {\sqrt {a \left (\sec \left (f x +e \right )+1\right )}\, \sqrt {-c \left (\sec \left (f x +e \right )-1\right )}\, \left (\ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )+1\right )-\ln \left (\frac {2}{\cos \left (f x +e \right )+1}\right )+\ln \left (-\cot \left (f x +e \right )+\csc \left (f x +e \right )-1\right )\right ) \cot \left (f x +e \right )}{f}\) \(87\)
risch \(\frac {\sqrt {\frac {a \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \sqrt {\frac {c \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right ) x}{\left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}-\frac {2 \sqrt {\frac {a \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \sqrt {\frac {c \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right ) \left (f x +e \right )}{\left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) f}-\frac {i \sqrt {\frac {a \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \sqrt {\frac {c \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )^{2}}{1+{\mathrm e}^{2 i \left (f x +e \right )}}}\, \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right ) \ln \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )}{\left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) f}\) \(323\)

[In]

int((c-c*sec(f*x+e))^(1/2)*(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/f*(a*(sec(f*x+e)+1))^(1/2)*(-c*(sec(f*x+e)-1))^(1/2)*(ln(-cot(f*x+e)+csc(f*x+e)+1)-ln(2/(cos(f*x+e)+1))+ln(
-cot(f*x+e)+csc(f*x+e)-1))*cot(f*x+e)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (44) = 88\).

Time = 0.33 (sec) , antiderivative size = 200, normalized size of antiderivative = 4.17 \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\left [\frac {\sqrt {-a c} \log \left (\frac {a c \cos \left (f x + e\right )^{4} - {\left (\cos \left (f x + e\right )^{3} + \cos \left (f x + e\right )\right )} \sqrt {-a c} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) + a c}{2 \, \cos \left (f x + e\right )^{2}}\right )}{2 \, f}, \frac {\sqrt {a c} \arctan \left (\frac {\sqrt {a c} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}{a c \cos \left (f x + e\right )^{2} + a c}\right )}{f}\right ] \]

[In]

integrate((c-c*sec(f*x+e))^(1/2)*(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[1/2*sqrt(-a*c)*log(1/2*(a*c*cos(f*x + e)^4 - (cos(f*x + e)^3 + cos(f*x + e))*sqrt(-a*c)*sqrt((a*cos(f*x + e)
+ a)/cos(f*x + e))*sqrt((c*cos(f*x + e) - c)/cos(f*x + e))*sin(f*x + e) + a*c)/cos(f*x + e)^2)/f, sqrt(a*c)*ar
ctan(sqrt(a*c)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sqrt((c*cos(f*x + e) - c)/cos(f*x + e))*cos(f*x + e)*si
n(f*x + e)/(a*c*cos(f*x + e)^2 + a*c))/f]

Sympy [F]

\[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\int \sqrt {a \left (\sec {\left (e + f x \right )} + 1\right )} \sqrt {- c \left (\sec {\left (e + f x \right )} - 1\right )}\, dx \]

[In]

integrate((c-c*sec(f*x+e))**(1/2)*(a+a*sec(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(a*(sec(e + f*x) + 1))*sqrt(-c*(sec(e + f*x) - 1)), x)

Maxima [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.81 \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=-\frac {{\left (f x + e - \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right )} \sqrt {a} \sqrt {c}}{f} \]

[In]

integrate((c-c*sec(f*x+e))^(1/2)*(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

-(f*x + e - arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1))*sqrt(a)*sqrt(c)/f

Giac [F]

\[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\int { \sqrt {a \sec \left (f x + e\right ) + a} \sqrt {-c \sec \left (f x + e\right ) + c} \,d x } \]

[In]

integrate((c-c*sec(f*x+e))^(1/2)*(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

sage0*x

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a+a \sec (e+f x)} \sqrt {c-c \sec (e+f x)} \, dx=\int \sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,\sqrt {c-\frac {c}{\cos \left (e+f\,x\right )}} \,d x \]

[In]

int((a + a/cos(e + f*x))^(1/2)*(c - c/cos(e + f*x))^(1/2),x)

[Out]

int((a + a/cos(e + f*x))^(1/2)*(c - c/cos(e + f*x))^(1/2), x)